package cn.lg.soar.system.biz.modules.monitor.entity;

import cn.lg.soar.database.base.entity.ITenantEntity;
import cn.lg.soar.database.handler.IgnoreFillHandle;
import cn.lg.soar.common.enums.LogTypeEnum;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * @author luguoxiang
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Getter
@Setter
@Schema(description = "日志对象")
@TableName("lg_sys_log")
public class OperationLog implements ITenantEntity, IgnoreFillHandle {

    @TableId
    private Long id;

    @Schema(description = "日志类型")
    private LogTypeEnum type;

    @Schema(description = "执行开始时间（何时）")
    private LocalDateTime startTime;

    @Schema(description = "租户id(何人)")
    private Integer tenantId;

    @Schema(description = "用户类型(何人)")
    private Integer userType;

    @Schema(description = "用户id(何人)")
    private Long userId;

    @Schema(description = "客户端类型(何地)")
    private Integer clientType;

    @Schema(description = "客户端ip(何地)")
    private String clientIp;

    @Schema(description = "客户端设备信息(何地)")
    private String userAgent;

    @Schema(description = "标题(何事)")
    private String title;

    @Schema(description = "耗时（毫秒）")
    private Integer duration;

    @Schema(description = "链路id")
    private String traceId;

    @Schema(description = "哪个接口")
    private String path;

    @Schema(description = "日志内容(简要说明)")
    private String content;

    @Schema(description = "java方法")
    private String javaMethod;

    @Schema(description = "方法入参")
    private String args;

    @Schema(description = "方法出参")
    private String result;

    @Schema(description = "错误堆栈信息")
    private String errorStack;

}
